﻿using System.Runtime.Serialization;

namespace NetBay.Core.BusinessEntities.Barcodes
{
    [DataContract]
    public class BarcodeResultItem : ReturnObject
    {

        /// <summary>
        /// Gets or sets the value.
        /// </summary>
        [DataMember]
        public string Value { get; set; }

        /// <summary>
        /// Gets or sets the type of the barcode.
        /// </summary>
        /// <value>The type of the barcode.</value>
        [DataMember]
        public BarcodeType BarcodeType { get; set; }

        /// <summary>
        /// Gets or sets the lenght.
        /// </summary>
        /// <value>The lenght.</value>
        [DataMember]
        public int Length { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="BarcodeResultItem" /> class.
        /// </summary>
        public BarcodeResultItem()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="BarcodeItem" /> class.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <param name="barcodeType">Type of the barcode.</param>
        /// <param name="lenght">The lenght.</param>
        public BarcodeResultItem(string value, BarcodeType barcodeType)
        {
            this.Value = value;
            this.BarcodeType = barcodeType;
            this.Length = value.Length;
        }

    }
}